package lecture02.exa01;

public class Example01 {
    public static void main(String[] args) {
        int a = 5;
        double b = 3;
        float c = 3.5f;
        boolean d = true;
        char f = 'c'; //字符用单引号，而且只能是一个字符
        String g = "This is a test!";



        System.out.println("整型:" + a);
        System.out.println("双精度浮点型:" + b);
        System.out.println("单精度浮点型:" + c);
        System.out.println("布尔型:" + d);
        System.out.println("字符:" + f);
        System.out.println("字符串:" + g);

        double z = 8.8;
        int s;
        s = (int) z; //强制类型转换
        System.out.println(z);
        System.out.println(s);
        // 如果/号两边都是整数，结果为整数，只要一边为小数，结果为小数
        System.out.println(5/2.0);

        int p = 7;
        System.out.println(p++);
        System.out.println(++p);




    }
}
